

export function isNonWhiteText (input?: unknown): input is string {
    if (typeof input === 'string') { return !!input.trim() }
    return false
}

export type T_MessageTextGenerator = (chiefMessageText?: string) => string;

const TOP_LEVEL_TITLE = 'XME'

export function createCategorizedMessage (categorizeTitleText: string): T_MessageTextGenerator {
    if (!isNonWhiteText(categorizeTitleText)) {
        categorizeTitleText = '「不明模块」'
    }

    categorizeTitleText = categorizeTitleText.trim()

    return function (chiefMessageText?: string): string {
        return `${TOP_LEVEL_TITLE}·${categorizeTitleText}： ${chiefMessageText}`
    }
}


